package com.xl.web.service.zoom;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.xl.base.annotation.DataSource;
import com.xl.base.page.Page;
import com.xl.base.page.PageBean;
import com.xl.core.enums.SourceEnum;
import com.xl.web.dao.zoom.DeptDao;
import com.xl.web.entity.zoom.Dept;
@Service(value = "deptService")
public class DeptService<T extends Dept> {
	@Resource
	private DeptDao<Dept> deptDao;
	@DataSource(source = SourceEnum.TYPE_SLAVE)
	public PageBean   queryPageDeptInfo(Dept dept,Page page){
		 PageHelper.startPage(page.getPageNum() ,page.getPageSize());
		 List<Dept> depts = deptDao.queryDeptInfo(dept);
		 PageBean  pageBean  = new PageBean(depts);
		 return pageBean;
	}
	@DataSource(source = SourceEnum.TYPE_SLAVE)
	public  List<Dept> queryDeptInfo(Dept dept){
		 List<Dept> depts = deptDao.queryDeptInfo(dept);
		 return depts;
	}
	
	@DataSource(source = SourceEnum.TYPE_SLAVE)
	public  List<Dept> queryDeptAndUser(Dept dept){
		 List<Dept> depts = deptDao.queryDeptAndUser(dept);
		 return depts;
	}
	


}
